package com.hmdp.config.bloomfilter;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.StringRedisTemplate;

import static com.hmdp.utils.RedisConstants.SHOP_BLOOM_FILTER;

//@Configuration
public class BloomFilterConfig {
    
    @Bean
    public RedisBloomFilter shopBloomFilter(StringRedisTemplate stringRedisTemplate) {
        return new RedisBloomFilter(
                stringRedisTemplate,
                SHOP_BLOOM_FILTER,  // Redis键名
                1_000_000,            // 预计存放100万个用户
                0.01                 // 1%误判率
        );
    }
}